---
title: "Processors | v1 Migration Guide"
description: "Learn how to migrate processor changes when upgrading to v1."
---

# Processors

Processor interfaces have been updated to use consistent naming patterns and database message types.

## Changed

### Processor configuration from `name` to `id`

Processors now require an `id` field instead of `name`. The `name` field is now optional. This change provides consistency with other Mastra entities like scorers and agents.

To migrate, update processor definitions to use `id` as the required field.

```diff
  import type { InputProcessor } from '@mastra/core/processors';

  const processor: InputProcessor = {
-   name: 'my-processor',
+   id: 'my-processor',
+   name: 'My Processor', // optional
    processInput: async ({ messages }) => {
      // ...
    },
  };
```

### Processor message types from `MastraMessageV2` to `MastraDBMessage`

Processor message types have changed from `MastraMessageV2` to `MastraDBMessage`. This change provides consistency with scorer configuration and better type safety by aligning with the database message format.

To migrate, update processor message type imports and usage.

```diff
  import type { InputProcessor } from '@mastra/core/processors';
- import type { MastraMessageV2 } from '@mastra/core/agent';
+ import type { MastraDBMessage } from '@mastra/core/agent';

  const processor: InputProcessor = {
    id: 'my-processor',
-   processInput: async ({ messages }: { messages: MastraMessageV2[] }) => {
+   processInput: async ({ messages }: { messages: MastraDBMessage[] }) => {
      // ...
    },
  };
```

## Removed

### Deprecated input processor exports

Deprecated input-processor exports which include the built-in processors have been removed from `@mastra/core/agent/input-processors/processors`. Use `@mastra/core/processors` instead. This change consolidates processor types under the unified `Processor` interface.

If you have used `InputProcessor`, replace it with `Processor` which implements a `processInput` function.

```diff
- import { InputProcessor, ModerationProcessor } from '@mastra/core/agent/input-processors/processors';
+ import { Processor, ModerationProcessor } from '@mastra/core/processors';
```
